<template>
  <div>
    <panel-statistic></panel-statistic>

    <div class="d-flex mb-2">
      <div class="card flex-1 mr-3">
        <div class="card-body">
          <panel-task></panel-task>
        </div>
      </div>
      <div class="card flex-1 mr-3">
        <div class="card-body">
          <panel-tools :doc-id="docId"></panel-tools>
        </div>
      </div>
      <div class="card flex-1">
        <div class="card-body">
          <panel-bigdata></panel-bigdata>
        </div>
      </div>
    </div>

    <div class="card mb-3">
      <div class="card-body">
        <chart-customer-area></chart-customer-area>
      </div>
    </div>

    <div class="text-muted text-center" style="line-height: 1">
      <template v-if="copyrightData && copyrightData.record_number">
        <small>
          {{ copyrightData.copyright }} 备案号：
          <a href="//beian.miit.gov.cn" target="_blank">{{ copyrightData.record_number }}</a>
        </small>
        <br />
        <small>{{ copyrightData.entity }}</small>
        <small class="ml-2">{{ copyrightData.operate_entity }}</small>
      </template>
      <template v-else>
        <div class="text-muted text-center" style="line-height: 1">
          <small v-html="copyright"></small>
        </div>
        <ul class="list-inline text-center">
          <li class="list-inline-item" v-for="(link, index) in friendLink" :key="index">
            <small>
              <a :href="link.url" target="_blank">{{ link.name }}</a>
            </small>
          </li>
        </ul>
      </template>
    </div>
  </div>
</template>
<script>
import PanelStatistic from '@/credit/views/city/index/PanelStatistic'
import PanelTask from './PanelTask'
import PanelTools from '@/credit/views/county/index/PanelTools'
import PanelBigdata from '@/credit/views/county/index/bigdata/Index'
import ChartCustomerArea from '@/credit/views/city/index/ChartCustomerArea'
import { TEXT_COPYRIGHT } from '@/common/plugins/constant'

export default {
  components: {
    PanelStatistic,
    PanelTask,
    PanelBigdata,
    ChartCustomerArea,
    PanelTools,
  },
  props: {},
  data() {
    return {
      copyright: TEXT_COPYRIGHT,
      copyrightData: {},
      height: 280,
      friendLink: [
        { name: '贵州省农业信贷担保股份有限公司', url: 'https://gznyxd.cn/' },
        { name: '铜仁市财农信贷融资担保有限责任公司', url: 'http://www.trnxdb.com/' },
      ],
    }
  },
  computed: {
    docId() {
      return this.$route.query.docId
    },
  },
  watch: {},
  created() {
    this.getData()
  },
  mounted() {},
  methods: {
    getData() {
      this.$api.getData('credit', 'copyright_info').then(res => {
        this.copyrightData = res?.data?.[0] ?? {}
      })
    },
  },
}
</script>
<style scoped lang="scss"></style>
